package com.qf.controller.market;

import com.qf.service.DtsRegionService;
import com.qf.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**商场管理
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.controller
 * @Description:
 * @Date 2022/10/18 16:48
 */
@RestController
@RequestMapping("/admin/region")
public class AdminRegionController {

    @Autowired
    DtsRegionService regionService;

//    /admin/region/list?page=1&limit=20&name=%E6%90%9C%E7%B4%A0&code=123
    @GetMapping("/list")
    public Object list(@RequestParam(value = "page",required = false,defaultValue = "1") Integer page ,
                       @RequestParam(value = "limit",required = false,defaultValue = "20") Integer limit,
                       String name,Integer code){

        Map<String,Object> data = regionService.selectByPage(page,limit,name,code);
        return ResponseUtil.ok(data);

    }
}
